import { FormSchema } from '@/components/Form';
import { TreeItem } from '@/components/Tree';

export interface StateEntity {
  roleId: Number;
  treeData: TreeItem[];
  checkedMenu: number[];
  treeCheckedKeys: number[];
  menuCheckedKeys: number[];
}

export const getModalFormSchemas: FormSchema[] = [
  {
    field: 'name',
    label: '名称',
    required: true,
    component: 'Input',
  },
  {
    field: 'code',
    label: '代码',
    required: true,
    component: 'Input',
  },
  {
    field: 'status',
    label: '状态',
    component: 'RadioButtonGroup',
    defaultValue: 1,
    componentProps: {
      options: [
        { label: '启用', value: 1 },
        { label: '停用', value: 0 },
      ],
    },
  },
  {
    label: '排序',
    field: 'order_no',
    component: 'InputNumber',
    componentProps: {
      defaultValue: 0,
    },
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
  {
    label: ' ',
    field: 'menu',
    slot: 'menu',
  },
];
